package com.yunji.common.enums.business;

import java.util.Objects;

/**
 * @Project: yunji-coffee
 * @Package: com.yunji.storage.enums
 * @Title: StorageType
 * <p>
 * History:
 * Date                     Version     Author          Summary
 * ============================================================
 * 2024-08-19 09:48:59      V1.0        HuaAo       新建类
 */

public enum  StorageType {

    INTO_STORAGE(1,"入库"),
    OUT_STORAGE(2,"出库");

    private final Integer code;
    private final String text;

    StorageType(Integer code, String text) {
        this.code = code;
        this.text = text;
    }

    public Integer getCode() {
        return code;
    }

    public String getText() {
        return text;
    }

    public static String get(Integer code)
    {
        StorageType[] enums = StorageType.values();
        for (StorageType e: enums )
        {
            if (Objects.equals(e.code, code)) { return e.text; }
        }
        return null;
    }
}